﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NS_DBOP;

public partial class Flow_FlActionM : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Bind();
        }

    }

    public void Bind()
    {
        DataSet ds = new DBoperate().ExecuteQuery("select * from FlowAction", 0, 0, "table1");
        this.GridView1.DataSource = ds.Tables[0];
        this.GridView1.DataBind();
    }


    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        int strid = Convert.ToInt32(this.GridView1.DataKeys[e.RowIndex]["ID"].ToString());
        int result = new DBoperate().ExecuteUpdate("delete from FlowAction where ID=" + strid);
        if (result > 0)
        {
            Response.Write("<script language=javascript>alert('删除成功！')</script>");

        }
        else
        {
            Response.Write("<script language=javascript>alert('删除失败！')</script>");

        }
        Bind();
    }

    //public string getName(string id)
    //{
    //    string id = "1,2,3,4";
    //    string names = name.Split(new char[] { ',' });
    //    for (int i = 0; i < names.Length; i++)
    //    {
            
    //    }
    
    //}
}
